@nx/cypress 23.1.1 → 23.1.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.
|
@@ -5,10 +5,6 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
|
-
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
9
|
-
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
10
|
-
const plugin_cache_utils_1 = require("nx/src/utils/plugin-cache-utils");
|
|
11
|
-
const workspace_context_1 = require("nx/src/utils/workspace-context");
|
|
12
8
|
const path_1 = require("path");
|
|
13
9
|
const constants_1 = require("../utils/constants");
|
|
14
10
|
const cypressConfigGlob = '**/cypress.config.{js,ts,mjs,cjs}';
|
|
@@ -25,9 +21,9 @@ const defaultPatterns = {
|
|
|
25
21
|
exports.createNodes = [
|
|
26
22
|
cypressConfigGlob,
|
|
27
23
|
async (configFiles, options, context) => {
|
|
28
|
-
const optionsHash = (0,
|
|
29
|
-
const cachePath = (0, path_1.join)(
|
|
30
|
-
const pluginCache = new
|
|
24
|
+
const optionsHash = (0, internal_1.hashObject)(options);
|
|
25
|
+
const cachePath = (0, path_1.join)(internal_1.workspaceDataDirectory, `cypress-${optionsHash}.hash`);
|
|
26
|
+
const pluginCache = new internal_1.PluginCache(cachePath);
|
|
31
27
|
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
32
28
|
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
33
29
|
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
@@ -490,7 +486,7 @@ async function getSpecFilesAndPatternsForTestType(cypressConfig, testType, works
|
|
|
490
486
|
const excludeSpecPatterns = Array.isArray(excludeSpecPattern)
|
|
491
487
|
? excludeSpecPattern.map((p) => (0, path_1.join)(projectRoot, p))
|
|
492
488
|
: [(0, path_1.join)(projectRoot, excludeSpecPattern)];
|
|
493
|
-
const specFiles = await (0,
|
|
489
|
+
const specFiles = await (0, internal_1.globWithWorkspaceContext)(workspaceRoot, specPatterns, excludeSpecPatterns);
|
|
494
490
|
return { specFiles, specPatterns, excludeSpecPatterns };
|
|
495
491
|
}
|
|
496
492
|
async function filterCypressConfigs(configFiles, context) {
|
|
@@ -8,9 +8,7 @@ exports.createExecutorContext = createExecutorContext;
|
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
const fs_1 = require("fs");
|
|
11
|
-
const
|
|
12
|
-
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
13
|
-
const configuration_1 = require("nx/src/config/configuration");
|
|
11
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
14
12
|
exports.CY_FILE_MATCHER = new RegExp(/\.cy\.[tj]sx?$/);
|
|
15
13
|
/**
|
|
16
14
|
* return a path to a temp css file
|
|
@@ -55,8 +53,8 @@ function getProjectConfigByPath(graph, configPath) {
|
|
|
55
53
|
const normalizedPathFromWorkspaceRoot = (0, devkit_1.normalizePath)((0, fs_1.lstatSync)(configPath).isFile()
|
|
56
54
|
? configFileFromWorkspaceRoot.replace((0, path_1.extname)(configPath), '')
|
|
57
55
|
: configFileFromWorkspaceRoot);
|
|
58
|
-
const projectRootMappings = (0,
|
|
59
|
-
const componentTestingProjectName = (0,
|
|
56
|
+
const projectRootMappings = (0, internal_1.createProjectRootMappings)(graph.nodes);
|
|
57
|
+
const componentTestingProjectName = (0, internal_1.findProjectForPath)(normalizedPathFromWorkspaceRoot, projectRootMappings);
|
|
60
58
|
if (!componentTestingProjectName ||
|
|
61
59
|
!graph.nodes[componentTestingProjectName]?.data) {
|
|
62
60
|
throw new Error((0, devkit_1.stripIndents) `Unable to find the project configuration that includes ${normalizedPathFromWorkspaceRoot}.
|
|
@@ -69,8 +67,8 @@ function getProjectConfigByPath(graph, configPath) {
|
|
|
69
67
|
return graph.nodes[componentTestingProjectName].data;
|
|
70
68
|
}
|
|
71
69
|
function createExecutorContext(graph, targets, projectName, targetName, configurationName) {
|
|
72
|
-
const projectsConfigurations = (0,
|
|
73
|
-
const nxJsonConfiguration = (0,
|
|
70
|
+
const projectsConfigurations = (0, devkit_1.readProjectsConfigurationFromProjectGraph)(graph);
|
|
71
|
+
const nxJsonConfiguration = (0, internal_1.readNxJsonFromDisk)();
|
|
74
72
|
return {
|
|
75
73
|
cwd: process.cwd(),
|
|
76
74
|
projectGraph: graph,
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findBuildConfig = findBuildConfig;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
6
|
async function findBuildConfig(tree, options) {
|
|
8
7
|
try {
|
|
9
8
|
// attempt to use the provided target
|
|
@@ -118,8 +117,8 @@ function findTargetOptionsInProject(tree, graph, projectName, options) {
|
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
function createExecutorContext(graph, targets, projectName, targetName, configurationName) {
|
|
121
|
-
const nxJsonConfiguration = (0,
|
|
122
|
-
const projectsConfigurations = (0,
|
|
120
|
+
const nxJsonConfiguration = (0, internal_1.readNxJsonFromDisk)();
|
|
121
|
+
const projectsConfigurations = (0, devkit_1.readProjectsConfigurationFromProjectGraph)(graph);
|
|
123
122
|
return {
|
|
124
123
|
cwd: process.cwd(),
|
|
125
124
|
projectGraph: graph,
|
|
@@ -5,9 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const detect_port_1 = tslib_1.__importDefault(require("detect-port"));
|
|
8
|
-
const executor_utils_1 = require("nx/src/command-line/run/executor-utils");
|
|
9
8
|
const fs_1 = require("fs");
|
|
10
9
|
const os_1 = require("os");
|
|
10
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
11
11
|
const PORT_LOCK_DIR = (0, path_1.join)((0, os_1.tmpdir)(), 'nx-cypress-port-locks');
|
|
12
12
|
async function* startDevServer(opts, context) {
|
|
13
13
|
// no dev server, return the provisioned base url
|
|
@@ -136,8 +136,8 @@ ${e.message || e}`);
|
|
|
136
136
|
// so we double check the schema if readTargetOptions didn't return a value for the property
|
|
137
137
|
const projectConfig = context.projectsConfigurations?.projects?.[target.project];
|
|
138
138
|
const targetConfig = projectConfig.targets[target.target];
|
|
139
|
-
const [collection, executor] = (0,
|
|
140
|
-
const { schema } = (0,
|
|
139
|
+
const [collection, executor] = (0, internal_1.parseExecutor)(targetConfig.executor);
|
|
140
|
+
const { schema } = (0, internal_1.getExecutorInformation)(collection, executor, context.root, context.projectsConfigurations.projects);
|
|
141
141
|
// NOTE: schema won't have a default since readTargetOptions would have
|
|
142
142
|
// already set that and this check wouldn't need to be made
|
|
143
143
|
targetHasOpt = Object.keys(schema.properties).includes(property);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "23.1.
|
|
3
|
+
"version": "23.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"semver": "^7.6.3",
|
|
90
90
|
"tree-kill": "^1.2.2",
|
|
91
91
|
"tslib": "^2.3.0",
|
|
92
|
-
"@nx/devkit": "23.1.
|
|
93
|
-
"@nx/eslint": "23.1.
|
|
94
|
-
"@nx/js": "23.1.
|
|
92
|
+
"@nx/devkit": "23.1.2",
|
|
93
|
+
"@nx/eslint": "23.1.2",
|
|
94
|
+
"@nx/js": "23.1.2"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"nx": "23.1.
|
|
97
|
+
"nx": "23.1.2"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"cypress": ">= 13 < 16"
|